package com.qk.management.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.common.PageResult;
import com.qk.entity.domain.operateLog.OperateLogDO;
import com.qk.entity.dto.operateLog.OperateLogDTO;
import com.qk.entity.OperateLog;
import com.qk.management.mapper.OperateLogMapper;
import com.qk.management.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author fantuan
 * @created 2025/10/17 17:05
 * @description
 */
@Slf4j
@Service
@SuppressWarnings("all")
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {
    @Override
    public PageResult<OperateLogDO> operateLogList(OperateLogDTO dto) {
        Page<OperateLogDO> page = new Page<>(dto.getPage(), dto.getPageSize());
        Page<OperateLogDO> operateLogList = baseMapper.operateLogList(page, dto);
        return PageResult.<OperateLogDO>builder()
                .total(Long.valueOf(operateLogList.getTotal()).intValue())
                .rows(operateLogList.getRecords())
                .build();

    }
}
